Recorder: Show details of border nodes
authorMatthias Clasen <mclasen@redhat.com>
Thu, 28 Sep 2017 22:58:18 +0000 (18:58 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Thu, 28 Sep 2017 22:58:18 +0000 (18:58 -0400)
gtk/inspector/recorder.c

index 0da4f41abe77d4d35f41c3f716e1f7cc7d7ccc6a..6b2d2657c83f4ea8631b0bf705467736a624b654 100644 (file)
@@ -349,6 +349,34 @@ populate_render_node_properties (GtkListStore  *store,
       }
       break;
 
+    case GSK_BORDER_NODE:
+      {
+        const char *name[4] = { "Top", "Right", "Bottom", "Left" };
+        const float *widths = gsk_border_node_peek_widths (node);
+        const GdkRGBA *colors = gsk_border_node_peek_colors (node);
+        int i;
+
+        for (i = 0; i < 4; i++)
+          {
+            cairo_surface_t *surface;
+            char *text, *text2;
+
+            surface = get_color_surface (&colors[i]);
+            text = gdk_rgba_to_string (&colors[i]);
+            text2 = g_strdup_printf ("%.2f, %s", widths[i], text);
+            gtk_list_store_insert_with_values (store, NULL, -1,
+                                               0, name[i],
+                                               1, text2,
+                                               2, TRUE,
+                                               3, surface,
+                                               -1);
+            g_free (text);
+            g_free (text2);
+            cairo_surface_destroy (surface);
+          }
+      }
+      break;
+
     default: ;
     }
 }